package com.example.hidesms.dto;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class CallInfo implements Serializable {

	public static final long serialVersionUID = 1L;
	public int id;
	public String lookupKey;
	public byte[] image;
	public String name;
	public String number;
	// public String numberType;
	public int packageType;
	public long date;
	public String duration;
	public long cost;
	private int category;
	public int hide;
	public int hide_group;

	public CallInfo() {
		// id = -1;
		date = System.currentTimeMillis();
		packageType = 0;
		name = "";
		number = "";
		// numberType = "";
		duration = "";
		cost = 0;
		hide = 0;
		hide_group = 0;
		category = 0;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getNumber() {
		return number;
	}

	// public void setNumberType(String numberType) {
	// this.numberType = numberType;
	// }
	//
	// public String getNumberType() {
	// return numberType;
	// }

	public void setType(int type) {
		this.packageType = type;
	}

	public int getType() {
		return packageType;
	}

	public String getLogDate() {
		SimpleDateFormat dateFomat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
		return dateFomat.format(new Date(date));
	}

	public void setDate(long date) {
		this.date = date;
	}

	public long getDate() {
		return date;
	}


	public String getDuration() {
		return duration;
	}

	public void setDuration(String duration) {
		this.duration = duration;
	}

	public void setCost(long cost) {
		this.cost = cost;
	}

	public long getCost() {
		return cost;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	public byte[] getImage() {
		return image;
	}

	public Bitmap getBitmapImage() {
		Bitmap bitmap = null;
		if (image != null) {
			bitmap = BitmapFactory.decodeByteArray(image, 0, image.length);
		}

		return bitmap;
	}

	public void setLookupKey(String lookupKey) {
		this.lookupKey = lookupKey;
	}

	public String getLookupKey() {
		return lookupKey;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setHideGroup(int hhide_group) {
		this.hide_group = hide;
	}

	public int getHideGroup() {
		return hide_group;
	}

	public void setHide(int hide) {
		this.hide = hide;
	}

	public int getHide() {
		return hide;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	@Override
	public String toString() {
		return "CallInfo [number=" + number + ", date=" + date + ", cost="
				+ cost + ", category=" + category + "]";
	}
	
}